package com.example.temp;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;



import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

public  class myview extends View
{
      Paint paint = new Paint();

      public myview(Context context)
      {
            super(context);
            paint = new Paint();
            paint.setColor(Color.RED);
            paint.setStrokeWidth(4);

      }

      public myview(Context context, @Nullable AttributeSet attrs)
      {
            super(context, attrs);
      }

      public myview(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes)
      {
            super(context, attrs, defStyleAttr, defStyleRes);
      }

      public myview(Context context, @Nullable AttributeSet attrs, int defStyleAttr)
      {
            super(context, attrs, defStyleAttr);
      }

      @Override
      protected void onDraw(@NonNull Canvas canvas)
      {
            canvas.drawRect(new Rect(0, 0, 400, 400), paint);
            paint.setColor(Color.BLUE);
            canvas.drawRect(0, 0, 400, 400, paint);
            Log.e("tag", " 画完了" );
      }
}